export default function useConfig() {
  const { allRegionOptions } = useRegions()

  const tableColumns = computed(() => {
    return buildColumns([
      { title: '名称', dataIndex: 'name' },
      {
        title: '所属区域',
        dataIndex: 'region',
        render({ record }) {
          return getOptionLabel(record.region_id, allRegionOptions.value)
        },
      },
      { title: '交换机型号', dataIndex: 'sw_num' },
      { title: 'URL', dataIndex: 'url' },
      {
        title: '操作',
        slotName: 'actions',
        cellClass: 'actions-cell',
        width: 90,
      },
    ])
  })

  return {
    tableColumns,
  }
}
